package com.example.pc.videodemo.emq

import com.example.pc.videodemo.emq.model.MqttMassgePostBase
import com.google.gson.Gson

class MqttHelper(private val mqttMessageService: MqttMessageService) {
    private val gson = Gson()
    fun sendMessage(mqttMassgeBase: MqttMassgePostBase?) {
        try {
            mqttMessageService.publishMessage(gson.toJson(mqttMassgeBase))
        }catch (_:Exception){

        }
    }
}